feat(core): add event_flags to process_event #7046 🙀 #7066
feat(core): add event_flags to process_event #7046 🙀 #7066srl295 merged 4 commits intofeature-ldmlfrom
Conversation
- uint16_t - defined km_kbp_event_flags to define the bitfield - bitfield has value KM_KBP_EVENT_FLAG_TOUCH for touch events - ignored everywhere, currently
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
- use a constant, KM_KBP_EVENT_FLAG_DEFAULT for 0 - update pascal and python - update linux and windows
|
This has failing builds for Windows: and Developer: |
|
@mcdurdin looks like it was an out of date build that failed. I'll try rerunning… |
|
it actually probably could use some kind of test because it affects all of the process_event paths. but that could be done later, when further changes are made |
- pascal fix
|
uf.
but yet looking at the build log: e8dff5c#diff-8762b89391fb2aafa43506a684aedaae668bfff3551b906ac03ede86e7eb9141R115 it's being called with 5 arguments not 4. Is the build somehow out of date? |
should be
|
|
Discussion with @rc-swag —
|
I'm not terribly comfortable with this. The reason is,
For a public API, we would never change the shape or meaning of an API call -- we'd introduce an new API surface and mark the old one as deprecated. For an internal API, I am willing to have shape changes. Now, I know that in semantic versioning, the idea is that major releases can change APIs. I personally hate this: a given API function, once published, should remain stable both in shape and meaning for as long as that is viable -- only changing, for example, if security flaw repairs require it. This greatly simplifies the task of updating dependencies for downstream devs, and in the end we all win. |
|
I agree with what you say in principle and maybe the ship has already sailed. It's just in the space of a couple of months we have just added two arguments which are just flags. Each time the API call is changing and breaking by doing that. With this change, it is more resilient to future updates - at least for simple flags. I suggested this because the Happy to not have this change while better it is still not the ideal solution think we should look to better handling of event data across API boundaries in the future. |
|
Yep, good points. We do have more flexibility on the API given this is internal. Currently, we have the following API consumers that I am aware of:
And I'd forgotten about #5, FWIW. In terms of good API design, you are right too. I was concerned more with stability of existing APIs but it's a shame we didn't consider making key_down a bit flag from the beginning. Happy to be flexible as long as we can be sure we verify the changes properly (user test may be required?) |
mcdurdin
left a comment
There was a problem hiding this comment.
LGTM. I think the proposed flag change to process_event could be a follow-up PR at this point.
|
I think this pr already hits all call sites. I'll merge and we can consider followon, it's still the feature branch. |
to be clear I would keep the parameter count but change the type. But i do hear you about silent failures, if it's too compatible then we won't catch the issues.
this PR updates pascal and python already. In any event I'm unblocked from further work, so I think I will proceed with the meat of the implementation. |
km_kbp_event_flagsto define the bitfieldKM_KBP_EVENT_FLAG_TOUCHfor touch eventsFixes: #7046
@keymanapp-test-bot skip